Integrand size = 23, antiderivative size = 76 \[ \int \frac {\sin ^2(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {(a+2 b) x}{2 a^2}-\frac {\sqrt {b} \sqrt {a+b} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{a^2 f}-\frac {\cos (e+f x) \sin (e+f x)}{2 a f} \]
[Out]
Time = 0.11 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {4217, 482, 536, 209, 211} \[ \int \frac {\sin ^2(e+f x)}{a+b \sec ^2(e+f x)} \, dx=-\frac {\sqrt {b} \sqrt {a+b} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{a^2 f}+\frac {x (a+2 b)}{2 a^2}-\frac {\sin (e+f x) \cos (e+f x)}{2 a f} \]
[In]
[Out]
Rule 209
Rule 211
Rule 482
Rule 536
Rule 4217
Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {x^2}{\left (1+x^2\right )^2 \left (a+b+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{f} \\ & = -\frac {\cos (e+f x) \sin (e+f x)}{2 a f}+\frac {\text {Subst}\left (\int \frac {a+b-b x^2}{\left (1+x^2\right ) \left (a+b+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{2 a f} \\ & = -\frac {\cos (e+f x) \sin (e+f x)}{2 a f}-\frac {(b (a+b)) \text {Subst}\left (\int \frac {1}{a+b+b x^2} \, dx,x,\tan (e+f x)\right )}{a^2 f}+\frac {(a+2 b) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 a^2 f} \\ & = \frac {(a+2 b) x}{2 a^2}-\frac {\sqrt {b} \sqrt {a+b} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{a^2 f}-\frac {\cos (e+f x) \sin (e+f x)}{2 a f} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.61 (sec) , antiderivative size = 245, normalized size of antiderivative = 3.22 \[ \int \frac {\sin ^2(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {(a+2 b+a \cos (2 (e+f x))) \sec ^2(e+f x) \left (\frac {\arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{\sqrt {b} \sqrt {a+b} f}-\frac {-4 (a+2 b) x-\frac {\left (a^2+8 a b+8 b^2\right ) \arctan \left (\frac {\sec (f x) (\cos (2 e)-i \sin (2 e)) (-((a+2 b) \sin (f x))+a \sin (2 e+f x))}{2 \sqrt {a+b} \sqrt {b (\cos (e)-i \sin (e))^4}}\right ) (\cos (2 e)-i \sin (2 e))}{\sqrt {a+b} f \sqrt {b (\cos (e)-i \sin (e))^4}}+\frac {2 a \cos (2 f x) \sin (2 e)}{f}+\frac {2 a \cos (2 e) \sin (2 f x)}{f}}{a^2}\right )}{16 \left (a+b \sec ^2(e+f x)\right )} \]
[In]
[Out]
Time = 0.57 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.03
method | result | size |
derivativedivides | \(\frac {-\frac {\left (a +b \right ) b \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {\left (a +b \right ) b}}\right )}{a^{2} \sqrt {\left (a +b \right ) b}}+\frac {-\frac {a \tan \left (f x +e \right )}{2 \left (1+\tan \left (f x +e \right )^{2}\right )}+\frac {\left (a +2 b \right ) \arctan \left (\tan \left (f x +e \right )\right )}{2}}{a^{2}}}{f}\) | \(78\) |
default | \(\frac {-\frac {\left (a +b \right ) b \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {\left (a +b \right ) b}}\right )}{a^{2} \sqrt {\left (a +b \right ) b}}+\frac {-\frac {a \tan \left (f x +e \right )}{2 \left (1+\tan \left (f x +e \right )^{2}\right )}+\frac {\left (a +2 b \right ) \arctan \left (\tan \left (f x +e \right )\right )}{2}}{a^{2}}}{f}\) | \(78\) |
risch | \(\frac {x}{2 a}+\frac {x b}{a^{2}}+\frac {i {\mathrm e}^{2 i \left (f x +e \right )}}{8 a f}-\frac {i {\mathrm e}^{-2 i \left (f x +e \right )}}{8 a f}-\frac {\sqrt {-a b -b^{2}}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b -b^{2}}-a -2 b}{a}\right )}{2 f \,a^{2}}+\frac {\sqrt {-a b -b^{2}}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b -b^{2}}+a +2 b}{a}\right )}{2 f \,a^{2}}\) | \(163\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 257, normalized size of antiderivative = 3.38 \[ \int \frac {\sin ^2(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\left [\frac {2 \, {\left (a + 2 \, b\right )} f x - 2 \, a \cos \left (f x + e\right ) \sin \left (f x + e\right ) + \sqrt {-a b - b^{2}} \log \left (\frac {{\left (a^{2} + 8 \, a b + 8 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (3 \, a b + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 4 \, {\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{3} - b \cos \left (f x + e\right )\right )} \sqrt {-a b - b^{2}} \sin \left (f x + e\right ) + b^{2}}{a^{2} \cos \left (f x + e\right )^{4} + 2 \, a b \cos \left (f x + e\right )^{2} + b^{2}}\right )}{4 \, a^{2} f}, \frac {{\left (a + 2 \, b\right )} f x - a \cos \left (f x + e\right ) \sin \left (f x + e\right ) + \sqrt {a b + b^{2}} \arctan \left (\frac {{\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{2} - b}{2 \, \sqrt {a b + b^{2}} \cos \left (f x + e\right ) \sin \left (f x + e\right )}\right )}{2 \, a^{2} f}\right ] \]
[In]
[Out]
\[ \int \frac {\sin ^2(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\int \frac {\sin ^{2}{\left (e + f x \right )}}{a + b \sec ^{2}{\left (e + f x \right )}}\, dx \]
[In]
[Out]
none
Time = 0.26 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.01 \[ \int \frac {\sin ^2(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {\frac {{\left (f x + e\right )} {\left (a + 2 \, b\right )}}{a^{2}} - \frac {\tan \left (f x + e\right )}{a \tan \left (f x + e\right )^{2} + a} - \frac {2 \, {\left (a b + b^{2}\right )} \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {{\left (a + b\right )} b}}\right )}{\sqrt {{\left (a + b\right )} b} a^{2}}}{2 \, f} \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.21 \[ \int \frac {\sin ^2(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {\frac {{\left (f x + e\right )} {\left (a + 2 \, b\right )}}{a^{2}} - \frac {2 \, {\left (\pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b + b^{2}}}\right )\right )} \sqrt {a b + b^{2}}}{a^{2}} - \frac {\tan \left (f x + e\right )}{{\left (\tan \left (f x + e\right )^{2} + 1\right )} a}}{2 \, f} \]
[In]
[Out]
Time = 18.39 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.46 \[ \int \frac {\sin ^2(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {\mathrm {atanh}\left (\frac {\sin \left (e+f\,x\right )\,\sqrt {-b^2-a\,b}}{a\,\cos \left (e+f\,x\right )+b\,\cos \left (e+f\,x\right )}\right )\,\sqrt {-b^2-a\,b}-a\,\left (\frac {\sin \left (2\,e+2\,f\,x\right )}{4}-\frac {\mathrm {atan}\left (\frac {\sin \left (e+f\,x\right )}{\cos \left (e+f\,x\right )}\right )}{2}\right )+b\,\mathrm {atan}\left (\frac {\sin \left (e+f\,x\right )}{\cos \left (e+f\,x\right )}\right )}{a^2\,f} \]
[In]
[Out]